//公共方法
import base from './base'
import axios from '@/utils/request'
const api ={
    totalInfo(){
        return axios.get(base.totalInfo)
    },

    orderInfo(){
        return axios.get(base.orderInfo)
    },
    
    format(){
        return axios.get(base.format)
    },

    projectList(page){
        return axios.get(base.projectList, { params: {  
            page: page // 确保 page 变量是你要传递的值  
        }   })
    },

    search(params) {
        return axios.get(base.search, {params});//:{search: params} 
    },

    deleteItemById(params){
        return axios.get(base.deleteItemById, { params }); 
    },

    /* 
    商品类目
      params={type:cid} selectItemCategoryByParentId
    */
    selectItemCategoryByParentId(params) {
        console.log('商品类目---------------');
        return axios.get(base.selectItemCategoryByParentId, { params });
    },
/*
      添加商品
    params={title, image, sellPoint, price, cid, category, num, descs, paramsInfo}
*/

    insertTbItem(params) {
        return axios.get(base.insertTbItem, { params });
    },


    /* 
  批量删除
    {ids:字符串--id}
  */
    batchDelete(params) {
        return axios.get(base.batchDelete, { params });
    },
};

export default  api;